{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-btn-group">
            <a href="{:url('admin/link/add')}" class="layui-btn"><i class="fa fa-plus-circle"></i>添加</a>
        </div>
        <table class="layui-table layui-form">
            <thead>
                <tr>
                    <th>ID</th>
                    <th>合作伙伴名称</th>
                    <th>链接地址</th>
                    <th style="width:70px">排序</th>
                    <th style="width:70px">状态</th>
                    <th style="width:170px">操作</th>
                </tr>
            </thead>
            <tbody>
                {foreach name="list" item="v" empty="$empty"}
                <tr>
                    <td>{$v.id}</td>
                    <td>{$v.title}</td>
                    <td>{$v.href}</td>
                    <td><input type="text" name="sort" value="{$v.sort}" autocomplete="off" class="layui-input ajax-update" data-url="{:url('admin/link/edit', ['id' => $v.id])}"></td>
                    <td><input type="checkbox" name="status" lay-skin="switch" lay-filter="*" lay-text="启用|禁用" data-url="{:url('admin/link/edit', ['id' => $v.id])}" {if $v.status eq 1}checked="checked"{/if}></td>
                    <td>
                        <a href="{:url('admin/link/edit', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-normal"><i class="fa fa-edit"></i> 编辑</a>
                        <a href="{:url('admin/link/del', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-danger ajax-delete"><i class="fa fa-trash-o"></i> 删除</a>
                    </td>
                </tr>
                {/foreach}
            </tbody>
        </table>
        <div class="page">{$list->render()}</div>
    </div>
</div>
{/block}
